Updated pathaway and tef from Olaf.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 7 Jun 2005 20:27:17 +0000 (20:27 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 7 Jun 2005 20:27:17 +0000 (20:27 +0000)
gpsbabel/pathaway.c
gpsbabel/reference/pathaway-geo.loc [new file with mode: 0644]
gpsbabel/tef_xml.c
gpsbabel/testo

index 35c23ef9362fa2471de95c7be1258db649e556e4..e3af37279d2d419b82f4d354f5ca7e6c4697f5bf 100644 (file)
@@ -169,9 +169,10 @@ char *str_pool_getcpy(char *src, char *def)
  
 char *ppdb_fmt_float(const double val)
 {
+       char *c;
        char *str = str_pool_get(32);
        snprintf(str, 32, "%.8f", val);
-       char *c = str + strlen(str) - 1;
+       c = str + strlen(str) - 1;
        while ((c > str) && (*c == '0'))
        {
            *c = '\0';
@@ -188,6 +189,7 @@ char *ppdb_fmt_float(const double val)
 
 char *ppdb_fmt_degrees(char dir, double val)
 {
+       char *tmp;
        char *str = str_pool_get(32);
        int deg = abs(val);
        double min = 60.0 * (fabs(val) - deg);
@@ -201,7 +203,7 @@ char *ppdb_fmt_degrees(char dir, double val)
        snprintf(str, 31, "%c%02d 000", dir, deg);
        snprintf(str + 6 - power, 24, "%.8f", min);
        
-       char *tmp = str + strlen(str) - 1;      /* trim trailing nulls */
+       tmp = str + strlen(str) - 1;    /* trim trailing nulls */
        while ((tmp > str) && (*tmp == '0'))
        {
            *tmp = '\0';
@@ -248,7 +250,7 @@ double ppdb_decode_coord(const char *str)
 int ppdb_decode_tm(char *str, struct tm *tm)
 {
        int i = 3;
-       int msec, d1, d2, d3, d4;
+       int msec, d1, d2, d3, d4, year;
        time_t tnow;
        struct tm now;
     
@@ -272,7 +274,7 @@ int ppdb_decode_tm(char *str, struct tm *tm)
        now.tm_year += 1900;
        now.tm_mon++;
        
-       int year = (d1 * 100) + d2;
+       year = (d1 * 100) + d2;
        
        /* next code works for most, except for 19. and 20. of month */
        /* for trouble use input date format - !!! ToDo !!! */
@@ -303,10 +305,10 @@ static int ppdb_read_wpt(const struct pdb *pdb_in, const struct pdb_record *pdb_
        
        for (pdb_rec = pdb_in->rec_index.rec; pdb_rec; pdb_rec=pdb_rec->next) 
        {
+               int line = 0;
                waypoint *wpt_tmp = waypt_new();
                data = (char *) pdb_rec->data;
                
-               int line = 0;
                str = csv_lineparse(data, ",", """", line++);
                while (str != NULL)
                {
diff --git a/gpsbabel/reference/pathaway-geo.loc b/gpsbabel/reference/pathaway-geo.loc
new file mode 100644 (file)
index 0000000..8e7a019
--- /dev/null
@@ -0,0 +1,38 @@
+<?xml version="1.0"?><loc version="1.0" src="EasyGPS">
+<waypoint>
+<name id="GCEBB"><![CDATA[Mountain Bike Heaven by susy1313]]></name>
+<coord lat="35.972033" lon="-87.134700"/>
+</waypoint>
+<waypoint>
+<name id="GC1A37"><![CDATA[The Troll by a182pilot & Family]]></name>
+<coord lat="36.090683" lon="-86.679550"/>
+</waypoint>
+<waypoint>
+<name id="GC1C2B"><![CDATA[Dive Bomber by JoGPS & family]]></name>
+<coord lat="35.996267" lon="-86.620117"/>
+</waypoint>
+<waypoint>
+<name id="GC25A9"><![CDATA[FOSTER by JoGPS & Family]]></name>
+<coord lat="36.038483" lon="-86.648617"/>
+</waypoint>
+<waypoint>
+<name id="GC2723"><![CDATA[Logan Lighthouse by JoGps & Family]]></name>
+<coord lat="36.112183" lon="-86.741767"/>
+</waypoint>
+<waypoint>
+<name id="GC2B71"><![CDATA[Ganier Cache by Susy1313]]></name>
+<coord lat="36.064083" lon="-86.790517"/>
+</waypoint>
+<waypoint>
+<name id="GC309F"><![CDATA[Shy's Hill by FireFighterEng33]]></name>
+<coord lat="36.087767" lon="-86.809733"/>
+</waypoint>
+<waypoint>
+<name id="GC317A"><![CDATA[GittyUp by JoGPS / Warner Parks]]></name>
+<coord lat="36.057500" lon="-86.892000"/>
+</waypoint>
+<waypoint>
+<name id="GC317D"><![CDATA[Inlighting by JoGPS / Warner Parks]]></name>
+<coord lat="36.082800" lon="-86.867283"/>
+</waypoint>
+</loc>
index 392cacb203b0cd826865be7b9a209f42ed706756..a5e2ac624a781a0378e40221ecc7f5d57ad84e15 100644 (file)
@@ -31,7 +31,6 @@ static char *deficon = NULL;
 static waypoint *wpt_tmp = NULL;
 static int item_count = -1;
 static int waypoints = 0;
-static int mapsource = 0;
 
 static route_head *route = NULL;
 
@@ -194,7 +193,7 @@ tef_list_end(const char *args, const char **unused)
        waypoint_final();
        if (waypoints != item_count)
        {
-           fatal(MYNAME ": count waypoints differ to interlal ItemCount!\n");
+           fatal(MYNAME ": waypoint count differs to internal \"ItemCount\"! (%d to %d)\n", waypoints, item_count);
        }
 }
 
@@ -210,8 +209,6 @@ tef_item_start(const char *args, const char **attrv)
        wpt_tmp = waypt_new();
        wpt_tmp->centiseconds = 0;
        
-       waypoints++;
-       
        if ((waypoints == 1) || (waypoints == item_count)) 
            wpt_tmp->centiseconds++;
            
index c4cfc3e268aef2dc25f2839b4934fd54cee324bd..7b931e87b0535f90db6946754eb6b6b0088bdb31 100755 (executable)
@@ -690,9 +690,11 @@ ${PNAME} -i geo -f geocaching.loc -o text -F ${TMPDIR}/text.out -o html -F ${TMP
 #
 # TourExchangeFormat tef (read only)
 #
-rm -f ${TMPDIR}/tef_xms.mps
-${PNAME} -r -i tef -f reference/route/tef_xml.sample.xml -o mapsource -F ${TMPDIR}/tef_xml.mps
-bincompare ${TMPDIR}/tef_xml.mps reference/route/tef_xml.mps
+rm -f ${TMPDIR}/tef_xml*
+${PNAME} -r -i tef -f reference/route/tef_xml.sample.xml -o gpx -F ${TMPDIR}/tef_xml.sample.gpx
+grep -v "<time>" reference/route/tef_xml.sample.gpx > ${TMPDIR}/tef_xml.sample.gpx.ref
+grep -v "<time>" ${TMPDIR}/tef_xml.sample.gpx > ${TMPDIR}/tef_xml.sample.gpx.new
+compare ${TMPDIR}/tef_xml.sample.gpx.ref ${TMPDIR}/tef_xml.sample.gpx.new
 
 #
 # PathAway Palm Database .pdb tests